
553 P.2d 754 (1976)
Gerold R. RYAN, Plaintiff-Appellee,
v.
Dan CRONIN, Manager of Safety and Excise and Ex-Officio Sheriff of the City and County of Denver, and Wayne K. Patterson, Warden of the Jail of the City and County of Denver, Defendants-Appellants.
No. 27201.
Supreme Court of Colorado, En Banc.
August 30, 1976.
No appearance for plaintiff-appellee.
Max P. Zall, City Atty., Gerald Himelgrin, Asst. City Atty., Denver, for defendants-appellants.
ERICKSON, Justice.
This appeal was taken after the district court made a writ of habeas corpus absolute. Review of a ruling on a writ of habeas corpus lies in this court. Section 13-4-102(1) (c), C.R.S.1973.
The question which is before us is whether the writ of habeas corpus may be used in the district court as a means to review a contempt conviction in the county court. We hold that the proper means for review in this case was by appeal and not by habeas corpus, and accordingly, we reverse and remand with directions that the writ of habeas corpus be discharged.
The appellants had custody of Gerold R. Ryan. Ryan was charged with violating Denver Revised Municipal Code § 842.2-1 (disturbance of peace) and § 841.1-2 (interference with a public walkway). Ryan sought and obtained a jury trial. On the date that trial was set, Ryan and a number of witnesses appeared in the municipal court for the City and County of Denver wearing pins or buttons that bore inscriptions calling for the boycott of Gallo wines. The disturbance and picketing charges arose out of an attempt to boycott the sale of Gallo wines at a local liquor store. The trial judge ordered that the pins or buttons be removed prior to the commencement of trial and prior to the *755 time that the jury was selected and sworn. The defendant refused, and after a warning and consultation with counsel he again refused to comply with the order to remove the button or pin. The trial judge found Ryan to be in contempt, continued the trial, and jailed him until Ryan would remove the button and stand trial.
Thereafter, Ryan filed a petition for a writ of habeas corpus in the Denver district court. The district court reviewed the transcript of the proceedings in the county court and permitted evidence to be introduced relating to the buttons or pins in issue. Following a hearing, the district judge, after finding that the county court had jurisdiction over the person and the subject matter, declared:
"I think the Court was completely unreasonable in finding this man in contempt. Certainly, it is a violation of his First Amendment rights. He can testify to whatever he wants to, either orally or by advertising or whatever you want to call it. As I say, I think the finding of the defendant in contempt was completely unreasonable and the Writ will issue and the defendant will be ordered discharged."
It was undisputed that Ryan willfully disobeyed and violated the court's order relating to the removal of the button or pin. Thus, the only issue before us is whether the district court had jurisdiction to review the contempt order of the county court in a habeas corpus proceeding and could thereby bypass review by the superior court.
It is unquestioned that the county court had the inherent power to maintain order and to insure a fair trial. ABA Standards Relating to The Functions of the Trial Judge § 7.1. It is also clear that the court has the inherent power to punish summarily contempt of court when that contempt occurs in the presence of the court. Losavio v. District Court, 182 Colo. 180, 512 P.2d 266 (1973); In re Murley, 124 Colo. 581, 239 P.2d 706 (1951); Cooke v. United States, 267 U.S. 517, 45 S.Ct. 390, 69 L.Ed. 767 (1925); Ex parte Terry, 128 U.S. 289, 9 S.Ct. 77, 32 L.Ed. 405 (1888).
An admonition and warning was given. ABA Standards Relating to The Functions of the Trial Judge § 7.2. The trial court, in ruling that the button or pin should be removed, made it clear that the defendant's attempt to communicate with the jury by use of the pin or button was improper.
The Colorado Habeas Corpus Act and the rules of this court delineate the right which may be enforced with the Great Writ of Habeas Corpus, and the procedure which is to be followed. Section 13-45-101, 103, C.R.S.1973; C.R.C.P. 106; People ex rel. Mijares v. Kniss, 144 Colo. 551, 357 P.2d 352 (1960); Leonhart v. District Court, 138 Colo. 1, 329 P.2d 781 (1958).
Erroneous judgments are not subject to attack by use of the writ of habeas corpus. It is to be used only where the judgment is void. Hart v. Best, 119 Colo. 569, 205 P.2d 787 (1949).
The essential purpose to be served with a writ of habeas corpus is to resolve the issue of whether a person is unlawfully detained. Eathorne v. Nelson, 180 Colo. 288, 505 P.2d 1 (1973); Hithe v. Nelson, 172 Colo. 179, 471 P.2d 596 (1970); North v. Koch, 169 Colo. 508, 457 P.2d 915 (1969).
We have repeatedly declared that the writ of habeas corpus may not be used as a substitute for an appeal and that a hearing on a writ of habeas corpus may not be used as a basis for reviewing issues resolved by another court. King v. Tinsley, 158 Colo. 99, 405 P.2d 689 (1965); Johnson v. Tinsley, 155 Colo. 346, 394 P.2d 842 (1964).
The remedy available to Ryan after he was found in contempt and sentenced to jail was appeal. The proper court to review *756 the actions of the county court was the Denver superior court. Sections 13-7-102, C.R.S.1973.
The order of the district court is reversed, and the case is remanded to the district court with directions to discharge the writ of habeas corpus.
